
enum OsnRequestType: Int {
    case Friend = 0
    case InviteGroup
    case ApplyMember
    
    init(rawValue: Int) {
        switch rawValue {
        case 0: self = .Friend
        case 1: self = .InviteGroup
        case 2: self = .ApplyMember
        default: self = .Friend
        }
    }
}
enum OsnRequestStatus: Int {
    case Sent = 0
    case Accepted
    case Unread
    case Rejected
    case Readed
    
    init(rawValue: Int) {
        switch rawValue {
        case 0: self = .Sent
        case 1: self = .Accepted
        case 2: self = .Unread
        case 3: self = .Rejected
        case 4: self = .Readed
        default: self = .Sent
        }
    }
}
enum OsnRequestDir: Int {
    case Sent = 0
    case Recv
    
    init(rawValue: Int) {
        switch rawValue {
        case 0: self = .Sent
        case 1: self = .Recv
        default: self = .Sent
        }
    }
}
class DMCCRequest {
    var id: Int64 = 0
    var type = OsnRequestType.Friend
    var direction = OsnRequestDir.Recv
    var from = ""
    var to = ""
    var group = ""
    var reason = ""
    var recover = ""
    var hash = ""
    var status = OsnRequestStatus.Unread
    var timestamp: Int64 = 0
    
    func setStatus(_ status: OsnRequestStatus){
        self.status = status
    }
}
